﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.Command;

namespace PocketBook.UI.ViewModel
{
    public class WorkspaceViewModel : ViewModelBase
    {
        #region Constructor
        
        public WorkspaceViewModel()
        {
        } 

        #endregion

        #region Fields

        public string DisplayName { get; set; }

        #endregion

        #region Commands

        private RelayCommand _closeCommand;
        public RelayCommand CloseCommand
        {
            get
            {
                if (_closeCommand == null)
                    _closeCommand = new RelayCommand(() => this.OnRequestClose());

                return _closeCommand;
            }
        } 

        #endregion

        #region Close event
        
        public event EventHandler RequestClose;

        void OnRequestClose()
        {
            EventHandler handler = this.RequestClose;
            if (handler != null)
                handler(this, EventArgs.Empty);
        } 

        #endregion
    }
}
